<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            width: 100%;
            height: 100vh;
        }
        .out{
            width: 620px;
            height: 400px;
            margin: 0 auto;
            background: red;
        }
        .one{
            width: 300px;
            height: 100%;
            float: left;
            background: green;
        }
        .two{
            width: 300px;
            height: 100%;
            float: right;
            background: blue;
        }
        .one .top{
            width: 60%;
            height: 10%;
            background: black;
            margin: 0 auto;
            margin-top: 20px;
        }
        .one .bottom{
            width: 60%;
            height: 30%;
            background: #fff;
            margin: 0 auto;
            margin-top: 20px;
        }
    </style>
</head>
<body>
    <div class="out">
        <div class="one">
            <div class="top"></div>
            <div class="bottom"></div>
        </div>
        <div class="two">

        </div>
    </div>
    
    <script>
        var a = "ahsujbsdjkblfabfbdsbfalkjbfdlshkj"
        function str (str){
            // console.log(str.length)
            // console.log(str[0])
            obj={};
            for(let i = 0;i<str.length;i++){
                if(obj[str[i]]){
                    obj[str[i]] += 1
                }
                else{
                    obj[str[i]] =1
                }

            }
            let arr = []
            // console.log(obj.length)p
            for( let key in obj){
                arr.push(obj[key])
            }
            let maxContent = Math.max(...arr)
            // console.log(obj)
            for(let ff in obj ){
                if(obj[ff] == maxContent){
                    console.log("出现最多的数是：" + ff)
                    console.log( ff +"出现最多的次数是：" + maxContent +"次")
                }

            }

        }
        str(a);

        // var h = "ahsujbsdjkblfabfbdsbfalkjbfdlshkj"
        // var a = [];
        // var e = [];
        // var d = [];


        // function str(strs){
        //     a = (h.split(""))
        //     // console.log(a)
        //     for(let i = 0;i<a.length;i++){
                
        //         let b = a[i]
        //         console.log(b)
        //         var c = new RegExp("/"+b+"/ig");
                
        //         for(let j = 0;j<a.length;i++){
        //             console.log(c)
        //             var d = c.exec(atrs)
        //             console.log(d)
        //             // if(d.length > e.length){
        //             //     e.length = d.length
        //             // }
        //         }
        //     }

        // }
        // str(h);

    </script>
</body>
</html>